#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_mixer.h>
#include <assert.h>
#include "SDL\jeu.h"
#include "SDL\chargement.h"
void ChoixMap(int *pcontinuer)
{
int continuer=1,i=1;
SDL_Rect position_fond_base;
position_fond_base.x=0;
position_fond_base.y=0;
SDL_Event event;
SDL_Surface *ecrandebut = NULL, *fond_base= NULL;
SDL_Init(SDL_INIT_VIDEO);

ecrandebut= SDL_SetVideoMode(700, 719, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
fond_base= IMG_Load("choix1.jpg");
SDL_BlitSurface(fond_base, NULL, ecrandebut,&position_fond_base);
SDL_Flip(ecrandebut);

    while (continuer)
    {
switch (i){
case 1 : fond_base= IMG_Load("choix1.jpg");break;
case 2 : fond_base= IMG_Load("choix2.jpg");break;
case 3 : fond_base= IMG_Load("choix3.jpg");break;
}
SDL_BlitSurface(fond_base, NULL, ecrandebut,&position_fond_base);
   SDL_Flip(ecrandebut);
    SDL_WaitEvent(&event);
    switch (event.type)
     {
      case SDL_QUIT : continuer=0;*pcontinuer=0;break;
   case SDL_KEYDOWN :
          switch(event.key.keysym.sym)
          {
case SDLK_UP :
if (i==1)
{
i=3;
}
else
{
i--;
}
break;
case SDLK_DOWN :
if (i==3)
{
i=1;
}
else
{
i++;
}
break;

case SDLK_RETURN :
switch (i){
case 1 : Chargement(1,1);break;
case 2 : Chargement(1,2);break;
case 3 : Chargement(1,3);break;
}

break;

         }



break;

     }

SDL_FreeSurface(fond_base);
    }
SDL_FreeSurface(fond_base);
SDL_FreeSurface(ecrandebut);
}
